/**
 * Created by lizhe on 2018/4/17.
 */
var datas = [];
var first = [];
var second = [];
var third = [];

var menuId = 0;
var type = "";
var next = "";
$(document).ready(function(){
    menuId = getQueryString("menuId");
    type = getQueryString("type");
    next = getQueryString("next");
    queryList2(menuId);
    queryStudent(1,100000,menuId);
});

function queryStudent(page,pageSize,menuId){
    $.ajax({
        url : urladdr + "/web/article/list",
        method : "GET",
        data : {
            page:page,
            pageSize:pageSize,
            menuId:menuId,
            status:2
        },
        success : function(data){
            if(data.code == 0){
                $("#content").empty();
                $.each(data.data.list,function(i,date){
                    var ext = JSON.parse(date.ext);
                    if(ext.sex=="1"){
                        var sex = "男";
                    }else {
                        sex = "女";
                    }
                    document.getElementById("content").innerHTML = document.getElementById("content").innerHTML +
                        '<div class="divContent">'+
                        '<img src="'+imgUrl+date.imageUrl+'" class="studentImg">'+
                        '<div class="studentInfo">'+
                        '<div class="studentName">'+ext.position+'  '+date.title+'</div>'+
                        '<div class="Info" style="margin-top: 20px">班级：'+ext.class+'</div>'+
                        '<div class="Info">性别：'+sex+'</div>'+
                        '<div class="Info">年龄：'+ext.age+'岁</div>'+
                        '<div class="Info">星座：'+ext.star+'</div>'+
                        '<div class="Info">爱好：'+ext.hobby+'</div>'+
                        '<div class="Slogan">'+ext.brief+'</div>'+
                        '</div>'+
                        '</div>'
                });
            }else if(data.code == 401){
                location.href = "index.html"
            }else{
                modalinfo(data.msg);
            }
        }
    });
}